<style>

    body {
        font-family: 'Inter', system-ui, sans-serif;
        background-color: #f1f5f9;
    }


    .tag-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }


    .tag-card {
        transition: all 0.3s ease;
        border: none;
        border-radius: 0.75rem;
        overflow: hidden;
        gap: 1rem;
        padding: 1rem;
        background-color: white;
        margin-bottom: 1rem;
    }

    .tag-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
    }

    .tag-card.flex {
        display: flex;
    }

    .tag-card .tag-author {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .tag-card .tag-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }

    .tag-card .tag-stats {
        display: flex;
        align-items: center;
        gap: 1rem;
        font-size: 0.875rem;
        color: var(--secondary);
    }

    .tag-card .tag-stat {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .tag-card .tag-actions {
        display: flex;
        gap: 0.5rem;
    }

    .tag-card .tag-action-btn {
        border: none;
        background: none;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        transition: all 0.2s;
    }

    .tag-card .tag-action-btn:hover {
        background-color: var(--primary-light);
        color: var(--primary);
    }

    .tag-card .image-row {
        display: flex;
        gap: 4px;
        height: 140px;
    }

    .tag-card .image-row img {
        flex: 1;
        height: 100%;
        object-fit: cover;
    }

    .tag-card .image-single {
        height: 180px;
        flex-shrink: 0;
    }

    .tag-card .image-single img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0.5rem;
    }

    .tag-card .image-masonry {
        column-count: 2;
        column-gap: 4px;
        height: 180px;
    }

    .tag-card .image-masonry img {
        width: 100%;
        margin-bottom: 4px;
        object-fit: cover;
    }

    .tag-card .image-masonry img:first-child {
        height: 70%;
    }

    .tag-card .image-masonry img:last-child {
        height: 30%;
        margin-bottom: 0;
    }

    .tag-card .badge-pill {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }

    /**** 列表 ****/
    .tag-card .list-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .tag-card .list-footer {
        margin-top: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }


    @media (max-width: 768px) {
        .tag-card {
            flex-direction: column;
        }

        .tag-card .image-masonry, .tag-card .image-row {
            height: 120px;
        }
    }
</style>

<div class="container">
    <h1 class="mb-5 text-center">热门标签推荐</h1>

    <!-- 布局1：卡片网格布局 - 带单张图片 -->
    <h2 class="h4 mb-3 text-secondary">精选标签</h2>
    <div class="tag-grid mb-8">
        <div class="card tag-card shadow-sm">
            <div class="image-single">
                <img src="https://picsum.photos/600/400?random=1" alt="旅行摄影" class="w-100">
            </div>
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-start mb-2">
                    <h5 class="card-title mb-0">旅行摄影</h5>
                    <span class="badge bg-primary text-white badge-pill">热门</span>
                </div>
                <p class="card-text text-sm text-secondary mb-3 line-clamp-2">
                    分享旅途中的美好瞬间，交流摄影技巧和经验，记录世界各地的风景人文。
                </p>
                <div class="tag-author mb-3">
                    <img src="https://picsum.photos/100/100?random=101" alt="作者头像" class="tag-avatar">
                    <span class="text-sm font-medium">李明</span>
                </div>
                <div class="d-flex justify-content-between align-items-center">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 12.5k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 342</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 点赞</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 收藏</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="card tag-card shadow-sm">
            <div class="image-single">
                <img src="https://picsum.photos/600/400?random=2" alt="美食探店" class="w-100">
            </div>
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-start mb-2">
                    <h5 class="card-title mb-0">美食探店</h5>
                    <span class="badge bg-success text-white badge-pill">新标签</span>
                </div>
                <p class="card-text text-sm text-secondary mb-3 line-clamp-2">
                    发现城市里的隐藏美食，分享餐厅体验和私房菜谱，美食爱好者的交流社区。
                </p>
                <div class="tag-author mb-3">
                    <img src="https://picsum.photos/100/100?random=102" alt="作者头像" class="tag-avatar">
                    <span class="text-sm font-medium">王芳</span>
                </div>
                <div class="d-flex justify-content-between align-items-center">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 8.7k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 512</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 点赞</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 收藏</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="card tag-card shadow-sm">
            <div class="image-single">
                <img src="https://picsum.photos/600/400?random=3" alt="极简主义" class="w-100">
            </div>
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-start mb-2">
                    <h5 class="card-title mb-0">极简主义</h5>
                    <span class="badge bg-secondary text-white badge-pill">趋势</span>
                </div>
                <p class="card-text text-sm text-secondary mb-3 line-clamp-2">
                    探讨简约生活方式，分享极简设计、收纳技巧和断舍离经验，追求品质而非数量。
                </p>
                <div class="tag-author mb-3">
                    <img src="https://picsum.photos/100/100?random=103" alt="作者头像" class="tag-avatar">
                    <span class="text-sm font-medium">张伟</span>
                </div>
                <div class="d-flex justify-content-between align-items-center">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 6.3k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 218</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 点赞</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 收藏</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 布局2：卡片网格布局 - 带多张图片 -->
    <h2 class="h4 mb-3 text-secondary">生活方式</h2>
    <div class="tag-grid mb-8">
        <div class="card tag-card shadow-sm">
            <div class="image-row">
                <img src="https://picsum.photos/300/300?random=11" alt="户外露营" class="rounded-top-start">
                <img src="https://picsum.photos/300/300?random=12" alt="户外露营">
                <img src="https://picsum.photos/300/300?random=13" alt="户外露营" class="rounded-top-end">
            </div>
            <div class="card-body">
                <h5 class="card-title mb-2">户外露营</h5>
                <div class="tag-author mb-3">
                    <img src="https://picsum.photos/100/100?random=104" alt="作者头像" class="tag-avatar">
                    <span class="text-sm font-medium">刘强</span>
                </div>
                <div class="d-flex justify-content-between align-items-center">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 9.2k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 427</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 1.2k</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 356</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="card tag-card shadow-sm">
            <div class="image-masonry">
                <img src="https://picsum.photos/300/300?random=14" alt="手工制作">
                <img src="https://picsum.photos/300/300?random=15" alt="手工制作">
            </div>
            <div class="card-body">
                <h5 class="card-title mb-2">手工制作</h5>
                <div class="tag-author mb-3">
                    <img src="https://picsum.photos/100/100?random=105" alt="作者头像" class="tag-avatar">
                    <span class="text-sm font-medium">赵敏</span>
                </div>
                <div class="d-flex justify-content-between align-items-center">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 5.8k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 289</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 843</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 215</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="card tag-card shadow-sm">
            <div class="image-row">
                <img src="https://picsum.photos/300/300?random=16" alt="城市骑行" class="rounded-top-start">
                <img src="https://picsum.photos/300/300?random=17" alt="城市骑行" class="rounded-top-end">
            </div>
            <div class="card-body">
                <h5 class="card-title mb-2">城市骑行</h5>
                <div class="tag-author mb-3">
                    <img src="https://picsum.photos/100/100?random=106" alt="作者头像" class="tag-avatar">
                    <span class="text-sm font-medium">陈杰</span>
                </div>
                <div class="d-flex justify-content-between align-items-center">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 7.4k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 198</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 652</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 187</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 布局3：列表布局 - 混合有图和无图 -->
    <h2 class="h4 mb-3 text-secondary">兴趣爱好</h2>
    <div class="mb-8">
        <div class="tag-card flex">
            <div class="image-single">
                <img src="https://picsum.photos/300/300?random=21" alt="独立电影" class="list-image">
            </div>
            <div class="list-content">
                <div class="d-flex justify-content-between align-items-start mb-1">
                    <h5 class="mb-0">独立电影</h5>
                    <span class="badge bg-info text-white badge-pill">小众</span>
                </div>
                <p class="text-sm text-secondary mb-2 line-clamp-1">
                    分享独立电影资源，讨论导演风格和电影艺术，发现主流之外的精彩作品。
                </p>
                <div class="tag-author mb-2">
                    <img src="https://picsum.photos/100/100?random=107" alt="作者头像" class="tag-avatar"
                         style="width:28px;height:28px;">
                    <span class="text-sm">林嘉欣</span>
                </div>
                <div class="list-footer">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 3.2k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 156</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 421</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 98</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="tag-card flex">
            <!-- 无图片标签 -->
            <div class="list-content" style="padding-left: 0.5rem;">
                <div class="d-flex justify-content-between align-items-start mb-1">
                    <h5 class="mb-0">诗歌创作</h5>
                    <span class="badge bg-purple text-white badge-pill">文艺</span>
                </div>
                <p class="text-sm text-secondary mb-2 line-clamp-2">
                    分享原创诗歌作品，探讨诗歌创作技巧，交流阅读感受，寻找灵魂共鸣的文字。
                </p>
                <div class="tag-author mb-2">
                    <img src="https://picsum.photos/100/100?random=108" alt="作者头像" class="tag-avatar"
                         style="width:28px;height:28px;">
                    <span class="text-sm">徐志摩</span>
                </div>
                <div class="list-footer">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 2.8k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 204</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 512</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 136</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="tag-card flex">
            <div class="image-single">
                <img src="https://picsum.photos/300/300?random=22" alt="咖啡文化" class="list-image">
            </div>
            <div class="list-content">
                <div class="d-flex justify-content-between align-items-start mb-1">
                    <h5 class="mb-0">咖啡文化</h5>
                    <span class="badge bg-warning text-white badge-pill">热门</span>
                </div>
                <p class="text-sm text-secondary mb-2 line-clamp-1">
                    探讨咖啡历史、品鉴技巧、器具选择，分享手冲咖啡经验和精品咖啡馆推荐。
                </p>
                <div class="tag-author mb-2">
                    <img src="https://picsum.photos/100/100?random=109" alt="作者头像" class="tag-avatar"
                         style="width:28px;height:28px;">
                    <span class="text-sm">咖啡豆</span>
                </div>
                <div class="list-footer">
                    <div class="tag-stats">
                        <span class="tag-stat"><i class="far fa-eye"></i> 8.5k</span>
                        <span class="tag-stat"><i class="far fa-comment"></i> 376</span>
                    </div>
                    <div class="tag-actions">
                        <button class="tag-action-btn"><i class="far fa-heart"></i> 1.8k</button>
                        <button class="tag-action-btn"><i class="far fa-bookmark"></i> 423</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 布局4：紧凑网格布局 - 无图片标签 -->
    <h2 class="h4 mb-3 text-secondary">热门话题</h2>
    <div class="row row-cols-2 row-cols-md-3 row-cols-lg-4 gap-3 mb-8">
        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">科技前沿</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=110" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">科技达人</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 15.2k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 876</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">读书分享</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=111" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">书虫</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 12.8k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 632</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">健身塑形</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=112" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">健身教练</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 9.4k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 428</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">职场技能</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=113" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">职场导师</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 11.7k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 593</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">投资理财</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=114" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">财务顾问</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 13.5k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 721</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">宠物日常</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=115" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">铲屎官</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 16.3k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 915</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">游戏攻略</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=116" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">游戏达人</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 18.7k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 1254</span>
            </div>
        </div>

        <div class="bg-white p-3 rounded-lg shadow-sm tag-card">
            <h6 class="mb-2">外语学习</h6>
            <div class="tag-author mb-2">
                <img src="https://picsum.photos/100/100?random=117" alt="作者头像" class="tag-avatar"
                     style="width:24px;height:24px;">
                <span class="text-xs">语言教师</span>
            </div>
            <div class="tag-stats" style="font-size: 0.75rem; gap: 0.5rem;">
                <span class="tag-stat"><i class="far fa-eye"></i> 7.9k</span>
                <span class="tag-stat"><i class="far fa-comment"></i> 387</span>
            </div>
        </div>
    </div>
</div>


<script>
    // 点赞和收藏功能
    document.addEventListener('DOMContentLoaded', function () {
        // 点赞按钮功能
        const likeButtons = document.querySelectorAll('.tag-action-btn:has(.far.fa-heart), .tag-action-btn:has(.fas.fa-heart)');
        likeButtons.forEach(btn => {
            btn.addEventListener('click', function () {
                const icon = this.querySelector('i');
                const textNode = this.childNodes[1];
                const countText = textNode.textContent.trim();
                let count = parseInt(countText);

                if (icon.classList.contains('far')) {
                    // 点赞
                    icon.classList.remove('far');
                    icon.classList.add('fas', 'text-primary');
                    textNode.textContent = ` ${count + 1}`;
                    showToast('点赞成功');
                } else {
                    // 取消点赞
                    icon.classList.remove('fas', 'text-primary');
                    icon.classList.add('far');
                    textNode.textContent = ` ${count - 1}`;
                    showToast('已取消点赞');
                }
            });
        });

        // 收藏按钮功能
        const bookmarkButtons = document.querySelectorAll('.tag-action-btn:has(.far.fa-bookmark), .tag-action-btn:has(.fas.fa-bookmark)');
        bookmarkButtons.forEach(btn => {
            btn.addEventListener('click', function () {
                const icon = this.querySelector('i');

                if (icon.classList.contains('far')) {
                    // 收藏
                    icon.classList.remove('far');
                    icon.classList.add('fas', 'text-primary');
                    showToast('收藏成功');
                } else {
                    // 取消收藏
                    icon.classList.remove('fas', 'text-primary');
                    icon.classList.add('far');
                    showToast('已取消收藏');
                }
            });
        });

    });
</script>


